package mrdemo009;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
 
public class Test1 {
	/**
	 */

	public static void main(String[] args) throws Exception {

		Configuration conf = new Configuration(); // 加载配置文件
		 
		Job job = new Job(conf); // 创建一个job，供JobTracker使用
//		job.setJarByClass(Test1.class);

		job.setMapperClass(FlowMap.class);
		job.setReducerClass(FlowReduce.class);

//		FileInputFormat.setInputPaths(job, new Path("hdfs://192.168.52.100:8020/FlowInput"));
//		FileOutputFormat.setOutputPath(job, new Path("hdfs://192.168.52.100:8020/FlowOutput"));
		
		FileInputFormat.setInputPaths(job, new Path("c:/data/FlowInput"));
		FileOutputFormat.setOutputPath(job, new Path("c:/data/FlowOutput"));
		
		
		//map的输出数据的类型
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(FlowBean.class);

		job.waitForCompletion(true);

	}

}
